//
//  OMSalesNumberView.m
//  OMENGO_NEW
//
//  Created by 梁尚嘉 on 2017/6/1.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMSalesNumberView.h"
@interface OMSalesNumberView()
@property (nonatomic, strong) UILabel *elementLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@end

@implementation OMSalesNumberView

- (instancetype)init
{
    self = [super init];
    [self configure];
    return self;
}

- (void)configure
{
    UIColor *thumeColor = SM_lightBlueColor;//SM_thumeColor;//HEXCOLOR(@"#EF0000");
    _elementLabel = [UILabel new];
    _elementLabel.backgroundColor = thumeColor;
    _elementLabel.textColor = SM_whiteColor;
    _elementLabel.font = SM_CFont(24);
    _elementLabel.text = @"购买指数";
    _elementLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:_elementLabel];
    [_elementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.top.bottom.equalTo(@0);
        make.height.equalTo(@(SM_SIZE(30)));
        make.width.equalTo(@(SM_SIZE(100)));
    }];

    _contentLabel = [UILabel new];
    _contentLabel.layer.borderColor = thumeColor.CGColor;
    _contentLabel.layer.borderWidth = .5f;
    _contentLabel.textColor = thumeColor;
    _contentLabel.font =  _elementLabel.font ;
    _contentLabel.text = @"100";
    _contentLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:_contentLabel];
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_elementLabel.mas_right);
        make.top.bottom.equalTo(@0);
        make.width.equalTo(_elementLabel.mas_width);
        make.right.equalTo(@0);
    }];

}

- (void)setNum:(NSUInteger)num
{
    _num = num;
    _contentLabel.text = [@(num) stringValue];
}

@end
